<script type="text/javascript">
var sumFeeBin=0;
$(function(){
	$.post("cancelCard/getShowDetail",function(json){
		if(json.statusCode==DWZ.statusCode.error){
			navTabAjaxDone(json)
			return
		}
		$("input[name='citizenCardNo']").val(json.nominalfee.citizenCardNo);
		$("input[name='cardPName']").val(json.nominalfee.cardPName);
		$("input[name='releaseDate']").val(getDate(json.nominalfee.releaseDate));
		$("input[name='feeBlnByNominalfee']").val(json.nominalfee.feeBln)
		//$("input[name='citizenCardNo']").val(json.nominalfee.citizenCardNo)
		var content="";
		var list=json.deposit
		if(list.length==0){
			//20181210 hgl 修改以下一行
			content+="<tr><td colspan='4' align='center' >无押金信息</td></tr>"
		}else{
			for(var i=0;i<list.length;i++){
				var appStatus;
				if(list[i].appStatus=="1"){
					sumFeeBin+=parseInt(list[i].feeBln);
					appStatus="开通";
				}
				content+="<tr align='center'><td>"+list[i].appKindName+"</td><td>"+appStatus+
				"</td><td>"+getDate(list[i].openDate)+"</td><td>"+list[i].feeBln+"</td></tr>"
			}
		}
		$("#tbodyByDeposit").html(content);
	},"json")
})

function countFeeBin(){
	var feeBlnByNominalfee=$("input[name='feeBlnByNominalfee']").val();
	var sum=sumFeeBin+parseInt(feeBlnByNominalfee)
	alertMsg.confirm("应用押金一共："+sumFeeBin+"元" ,{
			okCall : function() {
				$("input[name='supplementCardCharge']").val(sum);
				$("input[name='balance']").val(sumFeeBin);
				$("input[name='refundMoney']").val(feeBlnByNominalfee);
				$.pdialog.closeCurrent(); 
			}	
		});
	}
</script>

<div class="pageContent">
	<form id="" method="post" action="" class="required-validate" onsubmit="return validateCallback(this,navTabAjaxDone);">
		<div class="pageFormContent" layoutH="56"> 
			<fieldset>
			<legend>基本信息</legend>
			<p>
				<label>市民卡号：</label>
				<input  type="text" class="" size="30"name="citizenCardNo" readonly="readonly" />
			</p>
			<p>
				<label>卡产品：</label>
				<input  type="text" class="" size="30"name="cardPName" readonly="readonly" />
			</p>
			</fieldset>
			<fieldset>
			<legend>工本费信息</legend>
			<p>
				<label>发卡日期：</label>
				<input  type="text" class="" size="30"name="releaseDate" readonly="readonly" />
			</p>
			<p>
				<label>工本费：</label>
				<input  type="text" class="" size="30"name="feeBlnByNominalfee" readonly="readonly" />
			</p>
			<p>
				<label>应退费用：</label>
				<input type="text"   name="feeBlnByNominalfee" size="30" readonly="readonly"/>
			</p>
            </fieldset>
            
            <fieldset>
			<legend>应用押金信息</legend>
            	<table class="list" width="100%" layoutH="326">
					<thead>
						<tr align="center">
							<th width="25%" >应用名称</th>
							<th width="25%" >应用状态</th>
							<th width="25%" >开通日期</th>
							<th width="25%" >押金</th>
						</tr>
					</thead>
					<tbody id="tbodyByDeposit">
								
					</tbody>
				</table>
			</fieldset>
			<div class="formBar">
			<ul>
				<li>
			<a class="button" onclick="countFeeBin()"><span>统计费用</span></a><br /><br />
			</li>
			</ul>
			</div>
		</div>
	</form>
</div>
